var phantomCommand = require('../../utils/phantomCommand');
var phantomSpawn = require('../../utils/phantomSpawn');

module.exports = function (req,res) {
  var url = req.query.url;

  var actionName = 'screenshot';

  var args = phantomCommand.build(actionName,{
    url:url
  });

  var phantom = phantomSpawn(args, function (result) {
    res.json({
      result:result
    })
  });
};